Skip to content

fix:修复pipeline版本为v5,修复每日探索开启加成识别错误#54

Open
21dczhang wants to merge 2 commits intoMaaXYZ:mainfrom
21dczhang:main
Open

fix:修复pipeline版本为v5,修复每日探索开启加成识别错误#54
21dczhang wants to merge 2 commits intoMaaXYZ:mainfrom
21dczhang:main

Conversation

@21dczhang
Copy link
Copy Markdown

@21dczhang 21dczhang commented Feb 18, 2026

Summary by Sourcery

引入迁移脚本并更新流水线资源,使流水线 JSON 定义与基于 v5.x JumpBack 的格式保持一致。

新功能:

  • 新增 migrate_pipeline_v5.py 工具,用于将旧版流水线 JSON 中的 is_sub/interrupt 字段转换为 v5.1 [JumpBack] 前缀格式,同时保留注释、顺序和缩进。

问题修复:

  • 调整多处流水线 JSON 定义,以便在 v5 流水线格式下,日常探索增益/奖励的识别能够正常工作。

改进优化:

  • 统一标准化各文件中的流水线 JSON 节点引用(next/on_error),以便通过全局收集的 is_sub 节点支持跨文件的 JumpBack 行为。
Original summary in English

Summary by Sourcery

Introduce a migration script and updated pipeline resources to align pipeline JSON definitions with the v5.x JumpBack-based format.

New Features:

  • Add a migrate_pipeline_v5.py tool to convert legacy pipeline JSON is_sub/interrupt fields into the v5.1 [JumpBack] prefix format while preserving comments, ordering, and indentation.

Bug Fixes:

  • Adjust multiple pipeline JSON definitions so that daily exploration buff/bonus recognition works correctly under the v5 pipeline format.

Enhancements:

  • Standardize pipeline JSON node references (next/on_error) across files to support cross-file JumpBack behavior using globally collected is_sub nodes.

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗨——我在这里给出了一些高层次的反馈:

  • main() 中使用 Path.is_relative_to 会将兼容性限制在 Python 3.9 及以上;如果你需要支持更早版本的 Python,可以改为使用基于 relative_to 的 try/except,或者手动进行前缀检查来替代。
  • 基于正则的 rebuild_json_with_comments 逻辑相当复杂,并且在 JSON 结构演变时(例如有嵌套对象或重复键名)可能会比较脆弱;建议将这个函数单独抽离出来,并使用各种边界情况的 JSONC 示例对其进行单元测试,以确保在引入新的字段或格式时仍能按预期工作。
给 AI Agent 的提示
Please address the comments from this code review:

## Overall Comments
- In `main()`, the use of `Path.is_relative_to` limits compatibility to Python 3.9+; if you need to support older Python versions, replace it with a try/except using `relative_to` or manual prefix checking.
- The regex-based `rebuild_json_with_comments` logic is quite complex and may be brittle when JSON shape evolves (e.g., nested objects or repeated key names); consider isolating and unit-testing this function with a variety of edge-case JSONC samples to ensure it behaves as expected when new fields or formats are introduced.

Sourcery 对开源项目是免费的——如果你觉得我们的评审有帮助,欢迎分享给更多人 ✨
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续的评审。
Original comment in English

Hey - I've left some high level feedback:

  • In main(), the use of Path.is_relative_to limits compatibility to Python 3.9+; if you need to support older Python versions, replace it with a try/except using relative_to or manual prefix checking.
  • The regex-based rebuild_json_with_comments logic is quite complex and may be brittle when JSON shape evolves (e.g., nested objects or repeated key names); consider isolating and unit-testing this function with a variety of edge-case JSONC samples to ensure it behaves as expected when new fields or formats are introduced.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `main()`, the use of `Path.is_relative_to` limits compatibility to Python 3.9+; if you need to support older Python versions, replace it with a try/except using `relative_to` or manual prefix checking.
- The regex-based `rebuild_json_with_comments` logic is quite complex and may be brittle when JSON shape evolves (e.g., nested objects or repeated key names); consider isolating and unit-testing this function with a variety of edge-case JSONC samples to ensure it behaves as expected when new fields or formats are introduced.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant